﻿/// <reference path="vswd-ext_2.0.2.js" />
var queryWin;
var QueryCloseEvent;
function OpenQuery(divConditionID, height, width, queryEvent) {
    Ext.get(divConditionID).show();
    if (!queryWin)
        queryWin = new Ext.Window({
            id: "Window1",
            title: "查询条件",
            height: height,
            width: width,
            layout: 'fit',
            autoShow: true,
            contentEl: divConditionID,
            collapsible: true,
            renderTo: "aspnetForm",
            closeAction: 'hide',
            listeners: {
                'hide': function () {
                    if (QueryCloseEvent)
                        QueryCloseEvent();
                }
            },
            buttons: [
                    {
                        text: '查询', handler: function () {
                            if (queryEvent)
                                queryEvent();
                        }
                    },
                    {
                        text: '关闭',
                        handler: function () {
                            queryWin.hide();
                        }
                    }]
        });
    queryWin.show();
    queryWin.tools.toggle.hide();
    //    queryWin.setPosition(200, 200);
    return false;
}